Skip to content

perf: defer docs wagmi config creation#257

Merged
deodad merged 1 commit intomainfrom
amp/lazy-wagmi-config
Apr 8, 2026
Merged

perf: defer docs wagmi config creation#257
deodad merged 1 commit intomainfrom
amp/lazy-wagmi-config

Conversation

@deodad
Copy link
Copy Markdown
Contributor

@deodad deodad commented Apr 8, 2026

Summary

  • stop creating two extra wagmi configs at module scope in src/components/Providers.tsx
  • remove the remaining eager runtime config = getConfig() export from src/wagmi.config.ts
  • keep wagmi type registration by exporting a Config type alias instead of a runtime config value

Why

This docs runtime was eagerly initializing Tempo wallet connectors during import, which booted 3 hidden wallet.tempo.xyz/embed iframes before any user interaction.

Perf Notes

I re-ran the repo perf trace flow against an isolated production harness that imports the real Providers component from this branch and from main.

Using node scripts/perf-trace.mjs --url ... --runs 3 --wait-ms 4000:

  • this branch averaged walletEmbedCount: 1
  • main averaged walletEmbedCount: 3

So the eager hidden wallet embed bootstraps dropped from 3 to 1 for the isolated provider path.

Verification

  • ./node_modules/.bin/biome check src/wagmi.config.ts src/components/Providers.tsx
  • ./node_modules/.bin/tsc --noEmit

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tempo-docs Ready Ready Preview, Comment Apr 8, 2026 8:04pm

Request Review

@deodad deodad changed the title Defer docs wagmi config creation chore: defer docs wagmi config creation Apr 8, 2026
@deodad deodad changed the title chore: defer docs wagmi config creation perf: defer docs wagmi config creation Apr 8, 2026
@deodad deodad merged commit a92ee64 into main Apr 8, 2026
9 checks passed
@deodad deodad deleted the amp/lazy-wagmi-config branch April 8, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant